package com.kunzai.aoprun;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Slf4j
public class DishAOP {


    /**
     * 前置通知的内容
     */
    @Before("serviceName()")
    public void serviceNameBefore(){
        System.out.println("现在是前置通知");
    }


    @Pointcut("execution(public * com.kunzai.server.service.DishService.selectName(..))")
    public void serviceName(){

    }

    /**
     * 开始后置通知
     */
    @After("selectLikeOne()")
    public void testOneTime(){
        System.out.println("现在是后置通知");
    }


    @Pointcut("execution(public * com.kunzai.server.service.DishService.selectLike(..))")
    public void selectLikeOne(){

    }





}
